import request from '@/utils/request'

export const login = (data:any) => {
	return request({
		  url:'/auth/login',
		  method:'post',
		  data:data,
	})
}

export const logout = () => {
	return request({
		  url:'/auth/logout',
		  method:'delete',
	})
}

export const setProfile = (data:any) => {
	return request({
		  url:'/system/user/profile',
		  method:'PUT',
		  data:data
	})
}

export const getUserProfile = () => {
	return request({
		  url:'/system/user/profile',
		  method:'get',
	})
}

export const setPassword = (data:any) => {
	return request({
		  url:'/system/user/profile/updatePwd',
		  method:'PUT',
		  params:data
	})
}

export const register = (data:any) => {
	return request({
		  url:'/auth/shopRegister',
		  method:'post',
		  data:data,
	})
}

export const getRouters = () => {
	return request({
	    url:'/system/menu/getRouters',
	    method:'get'
	})
}

export const getShopInfo = () => {
	return request({
		  url:'/storage/shop/getShopInfo',
		  method:'post',
	})
}

export const getUserInfo = () => {
	return request({
		  url:'/system/user/getInfo',
		  method:'get',
	})
}

export const getSubAccountList = (data:any, params:any) => {
	return request({
		  url:'/storage/shop/subAccount',
		  method:'post',
		  data:data,
		  params:params
	})
}

export const setSubAccountDel = (data:any) => {
	return request({
	    url:'/storage/shop/delUser',
	    method:'post',
	    data:data
	})
}

export const setSubAccountAdd = (data:any) => {
	return request({
	    url:'/storage/shop/addSubAccount',
	    method:'post',
	    data:data
	})
}
export const setSubAccountEdit = (data:any) => {
	return request({
	    url:'/storage/shop/updateUserNickName',
	    method:'post',
	    data:data
	})
}

export const getCorporate = (data: any) => {
	return request({
	    url:'/system/menu/corporateMenu',
	    method:'get',
		params:data
	})
}

export const updateSubUserMenu = (data: any, params:any) => {
	return request({
	    url:'/system/menu/updateSubUserMenu',
	    method:'post',
		data:data,
		params:params
	})
}

export const certify = (data: any) => {
	return request({
	    url:'/storage/shop/approve',
	    method:'post',
		data:data
	})
}







